/**
 * Created by GanJc on 2015/12/28.
 */
'use strict';

var url = require('url');

console.log(url.parse('http://user:pass@host.com:8080/path/to/file?query=string#hash'));
console.log(url.parse('http://127.0.0.1:8080/path/to/file?query=string#hash'));

var path = require('path');

// 解析当前目录:
var workDir = path.resolve('.'); // '/Users/michael'
console.log(workDir);
// 组合完整的文件路径:当前目录+'pub'+'index.html':
var filePath = path.join(workDir, 'pub', 'index.html');
// '/Users/michael/pub/index.html'
console.log(filePath);
